package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 收藏表
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-08-31
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("i_collection")
@ApiModel(value = "Collection", description = "收藏表")
@AllArgsConstructor
public class Collection extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 收藏人身份
     */
    @ApiModelProperty(value = "收藏人身份")
    @Size(max = 32, message = "收藏人身份长度不能超过32")
    @TableField(value = "user_type", condition = LIKE)
    @Excel(name = "收藏人身份")
    private String userType;

    /**
     * 收藏人id
     */
    @ApiModelProperty(value = "收藏人id")
    @TableField(value = "user_id")
    @Excel(name = "收藏人id")
    private Long userId;

    /**
     * 收藏品身份
     */
    @ApiModelProperty(value = "收藏品身份")
    @Size(max = 32, message = "收藏品身份长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "收藏品身份")
    private String subjectType;

    /**
     * 收藏品ID
     */
    @ApiModelProperty(value = "收藏品ID")
    @TableField(value = "subject_id")
    @Excel(name = "收藏品ID")
    private Long subjectId;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除1:已删除)")
    private Integer isDelete;


    @Builder
    public Collection(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, String userType, Long userId, String subjectType, 
                    Long subjectId, Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.userType = userType;
        this.userId = userId;
        this.subjectType = subjectType;
        this.subjectId = subjectId;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
